package com.application.lucky.bean.jsonBean;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

/**
 * create by liulp
 * on 2019-11-25 21:38
 */
@Entity
public class FriendSearchBean {
    /**
     * userId : 9
     * user : {"userId":9,"surfing":100134,"nickName":"100134","desc":"","headPic":"","sex":1,"birthday":""}
     * friendState : 1
     * createTime : 1569761507002
     * applyMessage : lixuce5
     */
    @Id
    private long id = 0L;
    private int userId;
    private int friendState;
    private long createTime;
    private String applyMessage;
    private boolean isAdd;
    private String nickName;
    private String headUrl;

    @Generated(hash = 12320828)
    public FriendSearchBean(long id, int userId, int friendState, long createTime, String applyMessage,
                            boolean isAdd, String nickName, String headUrl) {
        this.id = id;
        this.userId = userId;
        this.friendState = friendState;
        this.createTime = createTime;
        this.applyMessage = applyMessage;
        this.isAdd = isAdd;
        this.nickName = nickName;
        this.headUrl = headUrl;
    }

    @Generated(hash = 509802051)
    public FriendSearchBean() {
    }

    public FriendSearchBean(FriendApplyBean.FriendListBean copyBean) {
        this.userId = copyBean.getUserId();
        this.friendState = copyBean.getFriendState();
        this.createTime = copyBean.getCreateTime();
        this.applyMessage = copyBean.getApplyMessage();
        this.userId = copyBean.getUserId();
        this.nickName = copyBean.getUser().getNickName();
        this.headUrl = copyBean.getUser().getHeadPic();
        this.isAdd = true;
    }

    public FriendApplyBean.FriendListBean getUIBean() {
        FriendApplyBean.FriendListBean applyBean = new FriendApplyBean.FriendListBean();
        applyBean.setUserId(this.userId);
        applyBean.setFriendState(this.friendState);
        applyBean.setCreateTime(this.createTime);
        applyBean.setApplyMessage(this.applyMessage);
        applyBean.isAdd = true;
        FriendBean friendBean = new FriendBean();
        friendBean.setNickName(this.nickName);
        friendBean.setHeadPic(this.headUrl);
        applyBean.setUser(friendBean);
        return applyBean;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public boolean isAdd() {
        return isAdd;
    }

    public void setAdd(boolean add) {
        isAdd = add;
    }

    public int getFriendState() {
        return friendState;
    }

    public void setFriendState(int friendState) {
        this.friendState = friendState;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public String getApplyMessage() {
        return applyMessage;
    }

    public void setApplyMessage(String applyMessage) {
        this.applyMessage = applyMessage;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getHeadUrl() {
        return headUrl;
    }

    public void setHeadUrl(String headUrl) {
        this.headUrl = headUrl;
    }

    public boolean getIsAdd() {
        return this.isAdd;
    }

    public void setIsAdd(boolean isAdd) {
        this.isAdd = isAdd;
    }

}
